package com.example.demo.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
public class Show {
    private String showTheme;
    private String showLinkman;
    private String showPhone;
    private Timestamp showCareTime;
    private int showState;
    private String showContent;
    private String showFeedback;
    private String showComment;
    private Client kh;
    private User zxr;
    private Showtype ghlx;


    @Id
    @Column(name = "show_theme", nullable = false, length = 255)
    public String getShowTheme() {
        return showTheme;
    }

    public void setShowTheme(String showTheme) {
        this.showTheme = showTheme;
    }

    @Basic
    @Column(name = "show_linkman", nullable = false, length = 20)
    public String getShowLinkman() {
        return showLinkman;
    }

    public void setShowLinkman(String showLinkman) {
        this.showLinkman = showLinkman;
    }

    @Basic
    @Column(name = "show_phone", nullable = false, length = 20)
    public String getShowPhone() {
        return showPhone;
    }

    public void setShowPhone(String showPhone) {
        this.showPhone = showPhone;
    }

    @Basic
    @Column(name = "show_careTime", nullable = true)
    public Timestamp getShowCareTime() {
        return showCareTime;
    }

    public void setShowCareTime(Timestamp showCareTime) {
        this.showCareTime = showCareTime;
    }

    @Basic
    @Column(name = "show_state", nullable = false)
    public int getShowState() {
        return showState;
    }

    public void setShowState(int showState) {
        this.showState = showState;
    }

    @Basic
    @Column(name = "show_content", nullable = false, length = 255)
    public String getShowContent() {
        return showContent;
    }

    public void setShowContent(String showContent) {
        this.showContent = showContent;
    }

    @Basic
    @Column(name = "show_feedback", nullable = false, length = 255)
    public String getShowFeedback() {
        return showFeedback;
    }

    public void setShowFeedback(String showFeedback) {
        this.showFeedback = showFeedback;
    }

    @Basic
    @Column(name = "show_comment", nullable = true, length = 255)
    public String getShowComment() {
        return showComment;
    }

    public void setShowComment(String showComment) {
        this.showComment = showComment;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Show show = (Show) o;
        return showState == show.showState &&
                Objects.equals(showTheme, show.showTheme) &&
                Objects.equals(showLinkman, show.showLinkman) &&
                Objects.equals(showPhone, show.showPhone) &&
                Objects.equals(showCareTime, show.showCareTime) &&
                Objects.equals(showContent, show.showContent) &&
                Objects.equals(showFeedback, show.showFeedback) &&
                Objects.equals(showComment, show.showComment);
    }

    @Override
    public int hashCode() {
        return Objects.hash(showTheme, showLinkman, showPhone, showCareTime, showState, showContent, showFeedback, showComment);
    }

    @ManyToOne
    @JoinColumn(name = "show_clientID", referencedColumnName = "client_id")
    public Client getKh() {
        return kh;
    }

    public void setKh(Client kh) {
        this.kh = kh;
    }

    @ManyToOne
    @JoinColumn(name = "show_doPeopleID", referencedColumnName = "uid", nullable = false)
    public User getZxr() {
        return zxr;
    }

    public void setZxr(User zxr) {
        this.zxr = zxr;
    }

    @ManyToOne
    @JoinColumn(name = "show_typeID", referencedColumnName = "st_ID", nullable = false)
    public Showtype getGhlx() {
        return ghlx;
    }

    public void setGhlx(Showtype ghlx) {
        this.ghlx = ghlx;
    }
}
